package com.tyl.xtk.beans.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.tyl.xtk.config.validation.groups.Insert;
import com.tyl.xtk.config.validation.groups.Update;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

/**
 * create by tyl at 2025/9/9
 */
@EqualsAndHashCode(callSuper = true)
@TableName("permission_info")
@Data
public class Permission extends Record {

    @NotNull(groups = Update.class, message = "id不能为空")
    private Long id;

    @NotNull(groups = Insert.class, message = "权限名不能为空")
    @Length(min = 2, max = 30, message = "权限名长度应为2-30")
    private String name;

    @NotNull(groups = Insert.class, message = "权限码不能为空")
    @Length(min = 2, max = 30, message = "权限码长度应为2-30")
    private String code;

    @Length(max = 100, message = "权限描述长度应为0-100")
    private String remark;
}